<?php
namespace App\Tools;

//use EasyWechat\OfficialAccount\Application;
use EasyWeChat\OfficialAccount\Application;

class Wechat {
    private static $Instance = null;

    private static function createInstance() {
        $config = config('wechat.default');
        $app = new Application($config);
        return $app;
    }

    public static function getInstance() {
        if (self::$Instance == null) {
            self::$Instance = self::createInstance();
        }
        return self::$Instance;
    }

    public static function getOauth() {
        return self::getInstance()->getOauth();
    }
}